Superuser: browse site-wide admin action log (#1413)#1414
Merged
Conversation
…og (#1413) The admin index "Recent actions" sidebar is scoped to the current user's own actions (Django's for_user filter), so a superuser has no easy way to see what other editors/contributors have done. Every admin action is already recorded in django.contrib.admin.models.LogEntry; this surfaces it. Register LogEntry as a read-only, superuser-only ModelAdmin: - Filter by user / action type / content type; search object repr, change message, username/name. - Columns: time, user, colored action label, content type, link to the affected object (repr fallback for deletions), change summary. - Strictly read-only (append-only audit trail); superuser-only visibility matching the Grant/Award access model. - Shows under the Administration group as "Log entries". Adds regression tests pinning read-only + superuser-only enforcement, the end-to-end changelist (200 superuser / non-200 editor), and that the display columns don't raise on any action type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1413.
Problem
The admin index "Recent actions" sidebar is scoped to the current user's own actions (Django's
for_userfilter), so a superuser can only see My actions — no easy way to see what other editors/contributors have done. Every admin add/change/delete is recorded indjango.contrib.admin.models.LogEntry; it was just never surfaced.What this does (Option A)
Registers
LogEntryas a read-only, superuser-only admin so a superuser can browse everyone's admin activity:Tests
New
website/tests/test_logentry_admin.py(6 tests, all passing) pins:Screenshots
UI change — screenshot of the Log entries changelist to follow.
Notes
Considered Option B (widen the sidebar panel for superusers); not doing that here — the filterable changelist is the more useful tool.
🤖 Generated with Claude Code